<?php
/* @var $this ServiceController */
/* @var $model Service */

$this->breadcrumbs=array(
	Yii::t('base','Services')=>array('admin'),
	Yii::t('base','Manage'),
);
/*
$this->menu=array(
	array('label'=>'List Service', 'url'=>array('index')),
	array('label'=>'Create Service', 'url'=>array('create')),
);*/

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('service-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h1><?php echo Yii::t('base','Manage Service')?></h1>

<?php echo Yii::t('base','<p>
You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b>
or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
</p>');?>

<?php echo CHtml::link(Yii::t('base','Advanced Search'),'#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>
</div><!-- search-form -->
<a class="btn btn-small create" title="创建服务" href="<?php echo Yii::app()->request->baseUrl; ?>/service/create">创建服务</a>
<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'service-grid',
	'dataProvider'=>$model->search(),
	/*'filter'=>$model,*/
	'itemsCssClass'=>'responsive table table-striped table-bordered',
	'pager'=>array('class'=>'CLinkPager','hiddenPageCssClass'=>'','firstPageCssClass'=>'first paginate_button','htmlOptions'=>array('class'=>'dataTables_paginate paging_full_numbers"'),'header'=>""),
	'pagerCssClass'=>'pagination',
	'cssFile'=>false,
	'template'=>'{items}{summary}{pager}',
	/*
	 * <th class="sorting" role="columnheader" tabindex="0" aria-controls="datatable_example" rowspan="1" colspan="1" style="width: 57px;" 
	 * aria-label="Author: activate to sort column ascending">Author</th>
	 */
	'columns'=>array(
		/*array(
			'name'=>'service_id',
			'headerHtmlOptions'=>array(
				'style'=>'width:20%;',
			)
		),*/
		array(
			'name'=>'service_name',
			'headerHtmlOptions'=>array(
				'style'=>'width:25%;',
			),
		),
		array(
			'name'=>'code',
			'headerHtmlOptions'=>array(
				'style'=>'width:25%;',
			),
		),
		array(
			'class'=>'CButtonColumn',
			'header'=>Yii::t('base','Operate'),
			'template'=>'{delete}{update}',
			'updateButtonImageUrl'=>array('class'=>'gicon-edit'),
			'updateButtonOptions'=>array('class'=>'btn btn-small'),
			'deleteButtonImageUrl'=>array('class'=>'gicon-edit'),
			'deleteButtonOptions'=>array('class'=>'btn btn-inverse btn-small'),
			'headerHtmlOptions'=>array(
				'style'=>'width:30%;',
			),
		),
	),
)); ?>
